<!DOCTYPE html>
<html>
  <head>
    <title>text.html</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
   <script type="text/javascript" src="resources/script/js/tools/vo.js"></script> 
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
	<!-- <script type="text/javascript" src="resources/script/js/load.js"></script>  -->
  </head>
  <body>
  <div id="hahaa">
  	<div id='test-obj'>
    	<input type="button"  vo-m='click:hello' name="hello" value='xxx'/>
    	<input type="button" vo-m="click:alertMsg" name="no" value='nnn'/>
    	<div name="OK">
    	</div>
    	<input type="button" name="Hi" value='xxx'/>
    	<input type="text" name="Hello"/>
    </div>
    <div id="balabala"></div>
    </div>
   <!--  <div id="id" style="display:none;width:40px;overflow:hidden">
    	4.兼容性上面来说，如果你对象1在两个浏览器上面的offsetHeight不同，那你要设置对象2的高度的时候用的是他表现出来的高度还是style设置的高度呢？举个例子：ie6下面容器1style设置了height：100px；然而被子对象撑大了，你要设置容器2的高度跟容器1的高度相同，那么你是用style.height还是offsetHeight呢？
    </div> -->
    <script type="text/javascript">
	/* 	function spread(obj){
			obj.style.position = "absolute";
			obj.style.visibility = "hidden";
			obj.style.display = "";
			var height = obj.offsetHeight;
			obj.style.height = 0+"px";
			obj.style.visibility = "";
			obj.style.position = "";
			obj.timer = setInterval(function(){
				obj.style.height = obj.offsetHeight + 1.8 +"px";
				if(obj.offsetHeight == height){
					clearInterval(obj.timer);
				}
			});
		};
		spread(document.getElementById("id")); */
	</script>
  </body>
  <script type="text/javascript">
  window.onload = function(){
	  vo.events.add('test-obj','click','hello',function(){
		  console.log("奇葩做法");
	  },document.getElementById('hahaa'));
	  vo.events.trigger('test-obj','click','hello');
	 /* vo.events.add("click","alertMsg",function(){
		 console.log("吼吼吼");
	 },document.getElementById("test-obj")); */
 	obj = new vo.newObj({
 		el:'#test-obj',
 		datas:{
 			hello:'你好',
 			no:'张君宝',
 			Hi:'李苗苗',
 		},
 		methods:{
 			alertMsg:function(datas){
 				//输出绑定的element;
 				console.log(this.el);
 				//输出vo对象，也就是当前的this
 				console.log(this);
 				//调用方法
 				console.log(this.get("hello"));
 				//输出datas,datas作为方法的参数
 				console.log(datas);
 				this.trigger("ok");
 			},
 			ok:function(datas){
 				console.log(datas);
 				alert("OK");
 			},
 			hello:function(){
 				
 			}
 		}
 	});
	 function blur(datas){
		 this.modify('Hi','诚服于我吧');
		console.log(this);
	 }
	 //动态元素测试
	 for(var i = 0;i<5;i++){
		 var newObj0 = new vo.newObj({
			el:'#myId'+i,
			parent:'#balabala',
			html:"<input type='button' name='Hi' vo-m='click:blur'/>",
			datas:{
				Hi:'我是大魔王华德义'
			},
			methods:{
				blur:blur
			}
		 });
	 }
	 var reg = new RegExp(/a/);
	 console.log("H:\ssss");
	 console.log(reg.exec("asdfsdf\/"));
 /* 	obj.methods.alertMsg(); */
 	vo.plugin('get',function(){
 		console.log("get到了哦！");	
 	});
  }; 
  </script>
</html>
